package com.wqtz.chechai.utils;

import com.google.gson.Gson;
import com.orhanobut.logger.Logger;
import com.wqtz.chechai.bean.CarBrandBean;
import com.wqtz.chechai.bean.CarInfo;
import com.wqtz.chechai.bean.CarResult;
import com.wqtz.chechai.bean.CarSeriesDetailBean;
import com.wqtz.chechai.bean.City;
import com.wqtz.chechai.bean.ProviceShort;
import com.wqtz.chechai.bean.Province;
import com.wqtz.chechai.bean.SeriesBean;

/**
 * 项目名称： CheChai
 * 创建人 : Liberation
 * 创建时间: 2016/12/22 11:10
 */

public class JsonUtils {

	//返回车辆信息
	public static CarInfo getCarInfoBean(String json){
		Logger.e(json);
		return new Gson().fromJson(json,CarInfo.class);

	}

	//返回省份
	public static Province getProvinceInfoBean(String json){
		Logger.e(json);
		return new Gson().fromJson(json,Province.class);

	}

	//返回城市列表
	public static City getCityInfoBean(String json){
	//	Logger.e("城市列表"+json);
		City city = new Gson().fromJson(json,City.class);
		Logger.e(city.toString());
		return  city;

	}

	//返回车子品牌
	public static CarBrandBean getCarBrand(String json){
		CarBrandBean carBrandBean = new Gson().fromJson(json,CarBrandBean.class);
		Logger.e(carBrandBean.toString());
		return  carBrandBean;

	}

	//返回车系
	public static SeriesBean getCarSeries(String json){
		SeriesBean seriesBean = new Gson().fromJson(json,SeriesBean.class);
		Logger.e(seriesBean.toString());
		return  seriesBean;
	}

	//返回车辆详细信息
	public static CarSeriesDetailBean getCarSeriesDetail(String json){
		CarSeriesDetailBean seriesBean = new Gson().fromJson(json,CarSeriesDetailBean.class);
		Logger.e(seriesBean.toString());
		return  seriesBean;
	}

	//返回车辆查询结果
	public static CarResult getCarResult(String json){
		CarResult carResult= new Gson().fromJson(json,CarResult.class);
		Logger.e(carResult.toString());
		return  carResult;
	}

	//返回归属地列表
	public static ProviceShort getProvinceSort(String json){
		ProviceShort proviceShort= new Gson().fromJson(json,ProviceShort.class);
		return  proviceShort;

	}


}
